package com.time.sky.mapper;

import com.time.sky.entity.Uinfo;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UinfoMapper {
    @Select("SELECT * FROM Uinfo u LEFT JOIN BINFO b ON u.bid=b.bid")
    List<Uinfo> selectList();
    @Insert("insert into Uinfo(uname,sex,tic,tele,dynum,mpnum,bid) " +
            "values(#{uname},#{sex},#{sex},#{tic},#{tele},#{dynum},#{mpnum},#{bid})")
    void add(Uinfo uinfo);
    @Delete("delete from Uinfo where uid=#{uid}")
    void delete(int uid);
    @Select("SELECT * FROM Uinfo  where uid=#{uid}")
    Uinfo getById(int uid);
    @Update("update Uinfo set uname=#{uname},sex=#{sex},tic=#{tic},tele=#{tele},dynum=#{dynum},mpnum=#{mpnum},bid=#{bid} where uid=#{uid}")
    void update(Uinfo uinfo);
    @Select("select count(*) from Uinfo")
    int getRowCount();
}
